
#import "SMMineFansViewController.h"
#import "SMUserFollowCell.h"
@implementation SMMineFansViewController {
    NSArray *_data;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"我的粉丝";
    self.view.backgroundColor=UIColor.systemGroupedBackgroundColor;
    self.tableView.backgroundColor=UIColor.systemGroupedBackgroundColor;
    self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    [self.tableView registerClass:SMUserFollowCell.class forCellReuseIdentifier:@"cell"];
    NSMutableArray *arr=[NSMutableArray array];
    for(int i=0;i<16;i++){
        NSString *a=[NSString stringWithFormat:@"https://i.pravatar.cc/100?u=fans_%d", i];
        NSString *n=[NSString stringWithFormat:@"粉丝%d号", i+1];
        NSString *intro = @"对你很感兴趣，期待合作～";
        [arr addObject:@{@"avatar":a,@"name":n,@"intro":intro,@"following":@(arc4random_uniform(2)==0)}];
    }
    _data=arr; [self.tableView reloadData];
}
- (NSInteger)tableView:(UITableView*)t numberOfRowsInSection:(NSInteger)s{ return _data.count; }
- (CGFloat)tableView:(UITableView*)t heightForRowAtIndexPath:(NSIndexPath*)i{ return 76; }
- (UITableViewCell*)tableView:(UITableView*)t cellForRowAtIndexPath:(NSIndexPath*)i{
    SMUserFollowCell *c=[t dequeueReusableCellWithIdentifier:@"cell" forIndexPath:i];
    NSDictionary *d=_data[i.row];
    [c configureWithAvatar:d[@"avatar"] name:d[@"name"] intro:d[@"intro"] following:[d[@"following"] boolValue]];
    return c;
}
@end
